#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<assert.h>
using namespace std;
class Date
{
public:


	int GetMonthDay(int year, int month)
	{
		static int MonthDayArray[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
		if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)))
		{
			return 29;
		}
		else
		{
			return MonthDayArray[month];
		}
	}

	Date(int year=1900, int month=1, int day=1)
	{
		_year = year;
		_month = month;
		_day = day;
	}
	/*void Print()
	{
		cout << _year << "-" << _month << "-" << _day << endl;
	}*/
//private:
	int _year;
	int _month;
	int _day;
	bool operator==(const Date& d)
	{
		return _year == d._year && _month == d._month && _day == d._day;
	}

	bool operator>(const Date& d)
	{
		if (_year > d._year)
		{
			return true;
		}
		else if (_year == d._year && _month > d._month)
		{
			return true;
		}
		else if (_year == d._year && _month == d._month && _day > d._day)
		{
			return true;
		}
		return false;
	}

	Date operator+=(int day)
	{
		_day += day;
		while (day > GetMonthDay(_year, _month))
		{
			_day -= GetMonthDay(_year, _month);
			_month++;
			if (_month == 13)
			{
				++_year;
				_month = 1;
			}
		}
		return *this;
	}

	bool operator>=(const Date& d)
	{
		return *this > d || *this == d;
	}
};





int main()
{
	Date d1(2022, 9, 22);
	Date d2(2018, 10, 29);
	d1 += 50;
	cout << d1._month << d1._day << endl;
	
	/*cout << (d1 == d2) << endl;
	cout << (d1 > d2) << endl;*/
	return 0;
}